<?php
use_stylesheets_for_form($form);
use_javascripts_for_form($form);

use_stylesheet('/JSCal2/src/css/jscal2.css');
use_stylesheet('/JSCal2/src/css/border-radius.css');
//use_stylesheet('/JSCal2/src/css/gold/gold.css');
use_stylesheet('/JSCal2/src/css/steel/steel.css');
use_javascript('/JSCal2/src/js/jscal2.js');
use_javascript('/JSCal2/src/js/lang/es.js');
?>
<form action="<?php echo url_for('novedad/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<?php echo button_to('Cancelar', 'novedad/index')?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo button_to('Eliminar', 'novedad/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          &nbsp;<input type="submit" value="Guardar" />
        </td>
      </tr>
    </tfoot>
    <tbody><?php echo $form ?></tbody>
  </table>
</form>
<script type="text/javascript">//<![CDATA[
  var cal1=Calendar.setup({
    onSelect:function(cal){cal.hide()},
    trigger:"s_profesional_novedad_inicio",
    inputField:"s_profesional_novedad_inicio",
    dateFormat:"%Y-%m-%d %H:%M:00",
    disabled:function(date){if(!date.getDay())return true},
    min:new Date(),
    showTime:true
  });
  var cal2=Calendar.setup({
    onSelect:function(cal){cal.hide()},
    trigger:"s_profesional_novedad_fin",
    inputField:"s_profesional_novedad_fin",
    dateFormat:"%Y-%m-%d %H:%M:00",
    disabled:function(date){if(!date.getDay())return true},
    min:new Date(),
    showTime:true
  });
  //]]>
</script>